<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
<%@taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<t:baselayout>
    <jsp:attribute name="pageTitle">Mes cours</jsp:attribute>
    <jsp:body>
        <div class="alert alert-info alert-dismissable">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            Vous trouverez sur cette page tous les cours que vous avez suivi entièrement ou pas, ainsi que toutes les certifications que vous avez obtenues.
        </div>

        <div class="row">
            <div class="col-md-6 col-sm-12">
                <h2>Mes cours suivis</h2>
                <table class="table table-hover table-striped">
                    <thead>
                        <tr>
                            <th>Nom du cours</th>
                            <th>Date de début de lecture</th>
                        </tr>
                    </thead>
                    <tbody>
                        <c:forEach var="readCourse" items="${readCourses}">
                            <tr>
                                <td><a href="<c:url value='/course/${readCourse.course.id}'/>">${readCourse.course.name}</a></td> 
                                <td>${readCourse.readingDate}</td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </div>
            <div class="col-md-6 col-sm-12">
                <h2>Mes certifications</h2>
                <table class="table table-hover table-striped">
                    <thead>
                        <tr>
                            <th>Nom de la certification</th>
                            <th>Date d'obtention</th>
                            <th>Nom du cours lié</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <c:forEach var="certif" items="${certifications}">
                            <tr>
                                <td><a href="<c:url value='/certification/${certif.id}'/>">${certif.course.certificationName}</a></td>
                                <td>${certif.obtentionDate}</td>
                                <td><a href="<c:url value='/course/${certif.course.id}'/>">${certif.course.name}</a></td>
                                <td><a href="<c:url value='/certificationPrint/${certif.id}'/>">Imprimer</a></td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>

            </div>
        </div>
    </jsp:body>
</t:baselayout>
